<?php
declare (strict_types=1);

namespace app\admin\controller;

use think\facade\Cache;
use think\facade\View;
use addons\BuilderPlus\contract\Admin;

class Login
{
    /**
     * @var string 登录标识key
     */
    protected $session_id = 'admin_id';

    /**
     * @var string 登录密码标识key
     */
    protected $session_token = 'password_token';

    /**
     * @var int 当前模块type
     */
    protected $type = 1;

    use Admin;

    public function index(): string
    {
        if (empty(Cache::get('system'))) {
            Cache::set('system', \app\common\model\Config::lists());
        }
        View::assign('random', rand(1, 7) . '.jpg');

        return View::fetch();
    }
}